package com.lqk.observer;

/**
 * @author lqk
 * @date 2021/12/10 10:22
 *
 * 显示当前天气情况（可以理解成是气象站自己的网站）
 */
public class CurrentConditions {
    private float temperature;  // 温度
    private float pressure; // 气压
    private float humidity; // 湿度

    // 更新天气情况，是由 WeatherData 来调用，使用推送模式
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    public void display() {
        System.out.println("***Today mTemperature: " + temperature + "***");
        System.out.println("***Today mPressure: " + pressure + "***");
        System.out.println("***Today mHumidity: " + humidity + "***");
    }
}
